package company.laohu_F;

public class LaoHu2 {

    // x 剩余任务数
    // level 当前等级
    // 任务可以反复做
    public int maxLevel(int x, int level, int[][] tasks) {
        if (x == 0)
            return level;
        int n = tasks.length;
        int max = 0;
        for (int i = 0; i < n; i++) {
            if (level >= tasks[i][0])
                max = Math.max(max, maxLevel(x - 1, level + tasks[i][1], tasks));
        }
        return max;
    }
}
